<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>MyDaily登录界面</title>
<style type="text/css">
body {
	margin: 0px;
	padding: 0px;
	background: url(img/loginbg.jpeg) no-repeat;
	background-image: url(img/loginbg.jpeg);
	background-size: 100% 100%;
	background-attachment: fixed;
}

#login-kuang {
	width: 700px;
	height: 500px;
	margin: auto;
	margin-top: 150px;
}

#login {
	width: 700px;
	height: 450px;
}

.user, .shuru {
	margin-top: 50px;
	font-family: "黑体";
	font-size: 35px;
}

.user {
	margin-left: 150px;
}

#jizhu, #forget {
	margin-left: 150px;
	margin-top: 50px;
	font-size: 35px;
}

#username, #userpassword {
	width: 300px;
	height: 40px;
}

#jizhu {
	width: 20px;
	height: 20px;
}

a {
	text-decoration: none;
	color: #000000;
}

a:hover {
	color: #FF5722;
}

#denglu {
	width: 400px;
	height: 60px;
	margin-left: 150px;
	margin-top: 20px;
	font-size: 30px;
	line-height: 60px;
}

#denglu:hover {
	background-color: #1E9FFF;
}
</style>
</head>
<body>
	<%
	//判断是否存有cooki
	String names = "";
	String pwd = "";
	Cookie[] cookies = request.getCookies();// 得到cookie数组
	if (cookies != null) {
		for (Cookie ck : cookies) {
			if ("name".equals(ck.getName())) {
		names = ck.getValue();
			} else if ("password".equals(ck.getName())) {
		pwd = ck.getValue();
			}
		}
	}
	%>
	<div id="warp">
		<div id="login-kuang">
			<fieldset id="login">
				<legend style="font-size: 30px; color: white;">登录你的MyDialy</legend>
				<form action="LogionServlet" method="post">
					<span class="user" style="color: white;"><strong>用户:</strong></span> <input type="text"
						id="username" value="<%=names%>" name="username"
						required="required" class="shuru" /> <br> <span class="user" style="color: white;"><strong>密码:</strong></span>
					<input type="password" id="userpassword" value="<%=pwd%>"
						name="userpassword" required="required" class="shuru" /> <br>
					<input type="checkbox" name="Cookie" id="jizhu" value="30" /><span
						style="font-size: 25px; color: white;">记住密码</span> <a href="forget.jsp" id="forget"
						style="font-size: 25px; color: white;">忘记密码</a> <br> <br> <span
						style="color: red; margin-left: 250px;">
						 <%
 							if (request.getAttribute("msg") != null) {
 						%>
 						<%=request.getAttribute("msg")%> <%
 							}
 						%>
					</span> <br>
					<input type="submit" id="denglu" name="" value="登   录" />
				</form>

			</fieldset>
		</div>
	</div>
</body>
</html>